package xin.i18n.starter;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;
import xin.i18n.util.ResolverType;

/**
 * <pre>
 * i18n 配置信息
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2019/11/28
 */
@Data
@Accessors(chain = true)
@ConfigurationProperties(I18nProperties.PREFIX)
public class I18nProperties {
	
	public static final String PREFIX = "i18n";
	
	private String basename;
	
	private String defaultEncoding;
	
	private boolean concurrentRefresh;
	
	private boolean useCodeAsDefaultMessage;
	
	private int cacheSeconds;
	
	private String defaultLocale;
	
	private String supportedLocales;
	
	private Interceptor interceptor;
	
	@Data
	public static class Interceptor {
		private String name;
		private ResolverType type;
		private String patterns;
	}
}
